<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            //case后面必须接一个break进行结尾，否则回打印出来
            let day = Number(window.prompt(""));
            switch (day) {
                case 1:
                    document.write("今天是星期1");
                    break;
                case 2:
                    document.write("今天是星期2");
                    break;
                case 3:
                    document.write("今天是星期3");
                    break;
                case 4:
                    document.write("今天是星期4");
                    break;
                case 5:
                    document.write("今天是星期5");
                    break;
                case 6:
                    document.write("今天是星期6");
                    break;
                case 7:
                    document.write("今天是星期天");
                    break;
                default:
                    alert("请重新输入");
            }
        </script>
    </body>
</html>
